import 'package:love_newf/generated/json/base/json_convert_content.dart';
import 'package:love_newf/app/com/model/home_l_ive_item_model.dart';

HomeLiveItemModel $HomeLiveItemModelFromJson(Map<String, dynamic> json) {
  final HomeLiveItemModel homeLiveItemModel = HomeLiveItemModel();
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    homeLiveItemModel.userId = userId;
  }
  final int? roomId = jsonConvert.convert<int>(json['roomId']);
  if (roomId != null) {
    homeLiveItemModel.roomId = roomId;
  }
  final String? nick = jsonConvert.convert<String>(json['nick']);
  if (nick != null) {
    homeLiveItemModel.nick = nick;
  }
  final int? sex = jsonConvert.convert<int>(json['sex']);
  if (sex != null) {
    homeLiveItemModel.sex = sex;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    homeLiveItemModel.avatar = avatar;
  }
  final String? avatarFrame = jsonConvert.convert<String>(json['avatarFrame']);
  if (avatarFrame != null) {
    homeLiveItemModel.avatarFrame = avatarFrame;
  }
  final int? age = jsonConvert.convert<int>(json['age']);
  if (age != null) {
    homeLiveItemModel.age = age;
  }
  final String? province = jsonConvert.convert<String>(json['province']);
  if (province != null) {
    homeLiveItemModel.province = province;
  }
  final int? roomType = jsonConvert.convert<int>(json['roomType']);
  if (roomType != null) {
    homeLiveItemModel.roomType = roomType;
  }
  final int? onlineCount = jsonConvert.convert<int>(json['onlineCount']);
  if (onlineCount != null) {
    homeLiveItemModel.onlineCount = onlineCount;
  }
  final String? onlineAvatar = jsonConvert.convert<String>(
      json['onlineAvatar']);
  if (onlineAvatar != null) {
    homeLiveItemModel.onlineAvatar = onlineAvatar;
  }
  final int? coverUserId = jsonConvert.convert<int>(json['coverUserId']);
  if (coverUserId != null) {
    homeLiveItemModel.coverUserId = coverUserId;
  }
  final String? anchorAvatar = jsonConvert.convert<String>(
      json['anchorAvatar']);
  if (anchorAvatar != null) {
    homeLiveItemModel.anchorAvatar = anchorAvatar;
  }
  final String? anchorNick = jsonConvert.convert<String>(json['anchorNick']);
  if (anchorNick != null) {
    homeLiveItemModel.anchorNick = anchorNick;
  }
  final String? anchorAvatarFrame = jsonConvert.convert<String>(
      json['anchorAvatarFrame']);
  if (anchorAvatarFrame != null) {
    homeLiveItemModel.anchorAvatarFrame = anchorAvatarFrame;
  }
  final int? anchorAge = jsonConvert.convert<int>(json['anchorAge']);
  if (anchorAge != null) {
    homeLiveItemModel.anchorAge = anchorAge;
  }
  final String? anchorProvince = jsonConvert.convert<String>(
      json['anchorProvince']);
  if (anchorProvince != null) {
    homeLiveItemModel.anchorProvince = anchorProvince;
  }
  return homeLiveItemModel;
}

Map<String, dynamic> $HomeLiveItemModelToJson(HomeLiveItemModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['roomId'] = entity.roomId;
  data['nick'] = entity.nick;
  data['sex'] = entity.sex;
  data['avatar'] = entity.avatar;
  data['avatarFrame'] = entity.avatarFrame;
  data['age'] = entity.age;
  data['province'] = entity.province;
  data['roomType'] = entity.roomType;
  data['onlineCount'] = entity.onlineCount;
  data['onlineAvatar'] = entity.onlineAvatar;
  data['coverUserId'] = entity.coverUserId;
  data['anchorAvatar'] = entity.anchorAvatar;
  data['anchorNick'] = entity.anchorNick;
  data['anchorAvatarFrame'] = entity.anchorAvatarFrame;
  data['anchorAge'] = entity.anchorAge;
  data['anchorProvince'] = entity.anchorProvince;
  return data;
}

extension HomeLiveItemModelExtension on HomeLiveItemModel {
  HomeLiveItemModel copyWith({
    int? userId,
    int? roomId,
    String? nick,
    int? sex,
    String? avatar,
    String? avatarFrame,
    int? age,
    String? province,
    int? roomType,
    int? onlineCount,
    String? onlineAvatar,
    int? coverUserId,
    String? anchorAvatar,
    String? anchorNick,
    String? anchorAvatarFrame,
    int? anchorAge,
    String? anchorProvince,
  }) {
    return HomeLiveItemModel()
      ..userId = userId ?? this.userId
      ..roomId = roomId ?? this.roomId
      ..nick = nick ?? this.nick
      ..sex = sex ?? this.sex
      ..avatar = avatar ?? this.avatar
      ..avatarFrame = avatarFrame ?? this.avatarFrame
      ..age = age ?? this.age
      ..province = province ?? this.province
      ..roomType = roomType ?? this.roomType
      ..onlineCount = onlineCount ?? this.onlineCount
      ..onlineAvatar = onlineAvatar ?? this.onlineAvatar
      ..coverUserId = coverUserId ?? this.coverUserId
      ..anchorAvatar = anchorAvatar ?? this.anchorAvatar
      ..anchorNick = anchorNick ?? this.anchorNick
      ..anchorAvatarFrame = anchorAvatarFrame ?? this.anchorAvatarFrame
      ..anchorAge = anchorAge ?? this.anchorAge
      ..anchorProvince = anchorProvince ?? this.anchorProvince;
  }
}